/*
 * Copyright 2008 the Breachwalls OSS project and the Others.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
${template.generateJavaPackageSentence()}

<#list template.generateJavaImportClassSentences() as item>
${item}
<#if !item_has_next>

</#if>
</#list>
/**
 * ${model.getDescription()}.
 * @author todoken
 * @version $Revision$
 */
${template.getClassDefineSentence()}${model.getShortClassName()}${template.generateExtendsClassSentence()} implements ${template.addImportFullClassName("java.io.Serializable")} {

    /**
     * シリアルバージョンID.
     */
    private static final long serialVersionUID = 1L;

<#list model.getModelProperties() as property>
    /**
     * ${property.getDescription()}.
     */
<#if template.isList(property)>
    private ${template.addImportFullClassName("java.util.List")}<${template.addImportFullClassName(property.getModel())}> ${template.getCollectionFieldName(property)} = new ${template.addImportFullClassName("java.util.ArrayList")}<${template.addImportFullClassName(property.getModel())}>(0);
<#elseif template.isSet(property)>
    private ${template.addImportFullClassName("java.util.Set")}<${template.addImportFullClassName(property.getModel())}> ${template.getCollectionFieldName(property)} = new ${template.addImportFullClassName("java.util.HashSet")}<${template.addImportFullClassName(property.getModel())}>(0);
<#else>
    private ${template.addImportFullClassName(property.getModel())} ${property.getName()};
</#if>

</#list>
<#if model.isAbstractClass()>
    /**
     * ${model.getDescription()}を構築する.
     */
    protected ${model.getShortClassName()}() {
    }

<#else>
    /**
     * ${model.getDescription()}を構築する.
     */
    public ${model.getShortClassName()}() {
    }

</#if>
<#list model.getModelProperties() as property>
    /**
     * ${property.getDescription()}を取得する.
     * @return ${property.getDescription()}
     */
<#if template.isList(property)>
    public ${template.addImportFullClassName("java.util.List")}<${template.addImportFullClassName(property.getModel())}> get${template.getCollectionMethodName(property)}() {
        return ${template.getCollectionFieldName(property)};
    }
<#elseif template.isSet(property)>
    public ${template.addImportFullClassName("java.util.Set")}<${template.addImportFullClassName(property.getModel())}> get${template.getCollectionMethodName(property)}() {
        return ${template.getCollectionFieldName(property)};
    }
<#else>
    public ${template.addImportFullClassName(property.getModel())} get${template.getMethodName(property)}() {
        return ${property.getName()};
    }
</#if>

<#if template.isList(property)>
    /**
     * ${property.getDescription()}を設定する.
     * @param new${template.getCollectionMethodName(property)} ${property.getDescription()}
     */
    public void set${template.getCollectionMethodName(property)}(${template.addImportFullClassName("java.util.List")}<${template.addImportFullClassName(property.getModel())}> new${template.getCollectionMethodName(property)}) {
        this.${template.getCollectionFieldName(property)} = new${template.getCollectionMethodName(property)};
    }
<#elseif template.isSet(property)>
    /**
     * ${property.getDescription()}を設定する.
     * @param new${template.getCollectionMethodName(property)} ${property.getDescription()}
     */
    public void set${template.getCollectionMethodName(property)}(${template.addImportFullClassName("java.util.Set")}<${template.addImportFullClassName(property.getModel())}> new${template.getCollectionMethodName(property)}) {
        this.${template.getCollectionFieldName(property)} = new${template.getCollectionMethodName(property)};
    }
<#else>
    /**
     * ${property.getDescription()}を設定する.
     * @param new${template.getMethodName(property)} ${property.getDescription()}
     */
    public void set${template.getMethodName(property)}(${template.addImportFullClassName(property.getModel())} new${template.getMethodName(property)}) {
        this.${property.getName()} = new${template.getMethodName(property)};
    }
</#if>

</#list>
}
